package com.example.demo.arithmetic.datastructure.graph;

//import org.apache.commons.math3.geometry.spherical.twod.Edge;

import lombok.Getter;

import java.util.List;

/**
 * 图的顶点
 * 1、name
 * 2、边的集合
 */
public class Vertex {
    // 入度+1
    int inDegree;
    @Getter
    String name;
    // 边的集合
    List<Edge> edges;

    boolean visited = false;

    public Vertex(String name) {
        this.name = name;
    }

    public static class Edge {
        // 指向定点的名称
        Vertex linked;
        // 权重
        int weight;

        public Edge(Vertex linked) {
            this.linked = linked;
        }

        public Edge(Vertex linked, int weight) {
            this.linked = linked;
            this.weight = weight;
        }
    }
}
